namespace array_demo.Model.Queue
{
    public class LinkedQueue2<E>: IQueue<E>
    {
        private LinkedList2<E> linkedList1;

        public LinkedQueue2()
        {
            linkedList1 = new LinkedList2<E>();
        }

        public int Count => linkedList1.count;

        public bool IsEmpty => linkedList1.isEmpty;

        public E Dequeue()
        {
            return linkedList1.DeleteFirst();
        }

        public void Enqueue(E e)
        {
            linkedList1.AddLast(e);
        }

        public E Peek()
        {
            return linkedList1.GetFirst();
        }

        public override string ToString()
        {
            return "queue" + linkedList1.ToString() + "top";
        }  
    }
}